<?php

use app\assets\ApiAsset;
use app\assets\LayerAsset;
use app\assets\TableAsset;
use app\models\KeyMap;
use app\models\AgentBill;
use app\widgets\LinkPager;
use app\widgets\ManagerTableOp;
use yii\helpers\Html;
use yii\helpers\Url;

/**
 * @var $this yii\web\View
 * @var $user app\models\User
 * @var $billList app\models\UserBill[] 账单列表
 * @var $pagination yii\data\Pagination
 */

ApiAsset::register($this);
LayerAsset::register($this);
TableAsset::register($this);

$this->title = '代理商账单列表';
$this->params['breadcrumbs'][] = '代理商管理';
$this->params['breadcrumbs'][] = $this->title;
?>

<table class="table table-striped table-bordered table-hover">
    <thead>
    <tr>
        <th colspan="7">当前代理：<?php echo Html::encode($agent->username);?></th>
    </tr>
    <tr>
        <th>日期</th>
        <th>计费数量</th>
        <th>金额</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>

    <tbody>
    <?php foreach ($commissionList as $bill) {?>
        <tr>
            <td class="center"><?php echo Html::encode($bill->day);?></td>
            <th><?php echo $bill->pay_count;?></th>
            <td><?php echo $bill->money;?></td>
            <td><?php echo KeyMap::getValue('commission_status', $bill->status);?></td>
            <td><?php echo ManagerTableOp::widget(['items' => [
                    
                    // ['icon' => 'fa fa-file-excel-o', 'href' => Url::to(['/admin/card/bill', 'export'=>'excel', 'search_time' => $bill->day, 'search_username' => $agent->username]), 'btn_class' => 'btn btn-xs btn-success', 'tip' => '导出Excel文件', 'color' => 'green'],
                ]]);?>
            </td>
        </tr>
    <?php }?>
    </tbody>
</table>
<?php echo LinkPager::widget(['pagination' => $pagination]);?>

